using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

///Originally, I wanted to make a complicated-ass Message system, like what c++ uses, but then I thought...KISS.
///Look to each class to see their summary at the top and for what they're SUPPOSED to handle.
///
namespace MyImaginaryFriends_Redux
{
   
    public class MainType : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;

        InputHandler Input;
        ScreenHandler screenHandler;

        public MainType()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";


        }

       
        protected override void Initialize()
        {
            Input = new InputHandler();
            screenHandler = new ScreenHandler();


            base.Initialize();
        }

        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            screenHandler.LoadContent(Content);
        }

    
        protected override void UnloadContent()
        {
           //no need, for now.
        }

        protected override void Update(GameTime gameTime)
        {
            Input.Update();

            screenHandler.Update(Content, gameTime, Input);



            if (screenHandler.GetTitleScreenExitCmd())
                this.Exit();
            if (screenHandler.GetGameScreenExitCommand())
                this.Exit();

            base.Update(gameTime);
        }

       
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            screenHandler.Draw(spriteBatch);//may need to pass the graphics device for the options screen to be able to change stuff.
         
            base.Draw(gameTime);
        }
    }
}
